package com.xhs.design.adapter.impl;

import com.xhs.design.adapter.ApiAdapter;
import com.xhs.service.AdapterV2Service;

import javax.servlet.http.HttpServletRequest;

/**
 * @desc: v2版本的接口
 * @projectName: tools-parent
 * @author: xhs
 * @date: 2022/12/5 11:06
 * @version: JDK 1.8
 */
public class ApiV2AdapterImpl implements ApiAdapter {

    @Override
    public boolean supports(Object object) {
        return object instanceof AdapterV2Service;
    }

    @Override
    public Object handle(HttpServletRequest httpServletRequest, Object object) {
        AdapterV2Service apiV2Service = (AdapterV2Service) object;
        Object info = apiV2Service.getInfo();
        return info;
    }
}
